List of JavaScript methods

These methods are supported using JavaScript syntax.

Calling another procedure

In JavaScript procedures you can also call another JavaScript procedure just by including the procedure name. This also enables XpertRule @command syntax procedures to be invoked (i.e. called from the JavaScript syntax procedure). This is a useful way to utilise the more specialist XpertRule @commands that are not supported by the JavaScript syntax.

Calling an XpertRule procedure and an XpertRule function from a JavaScript procedure...
xpertrule.message('Message1','Sample','OK');
#xrProcedure.run();
xpertrule.message('Message3 ' + #xrFunction.run('Fred'),'Sample','OK');
XpertRule procedure 'xrProcedure'...
@Alert 'Message2','Sample','OK'
XpertRule function 'xrFunction'...
FUNCTION (param1:S):S
@SelectCase param1
  @Case 'John'
    @Return 'Manchester'
  @Case 'Fred'
    @Return 'London'
@EndSelect

xpertrule.decodeData

Syntax: xpertrule.decodeData(<Message string>);

xpertrule.encodeData

Syntax: xpertrule.encodeData([#object1, #object2], <include captured objects>, "XML"|"JSON");

xpertrule.findObject

Syntax: xpertrule.findObject(<object name>)

xpertrule.getValuesToObject

Syntax: xpertrule.getValuesToObject([<object id array>])

xpertrule.lineOfReasoning

Syntax: xpertrule.lineOfReasoning()

xpertrule.message

Syntax: xpertrule.message(<contents>[,<title>]);

xpertrule.pause

Syntax: xpertrule.pause(<passed string data>);

xpertrule.phone

Syntax: xpertrule.phone(<method>,<param array of strings>);

xpertrule.phoneFeature

Syntax: xpertrule.phoneFeature(<method>);

xpertrule.setValuesWithObject

Syntax: xpertrule.setValuesWithObject(<xpertrule format javascript object>);

xpertrule.urlFetch

Syntax: xpertrule.urlFetch(<url>[,<post data string>])

xpertrule.disableUI

Syntax: xpertrule.disableUI(<optional css property object>);

Disable the user interface. This is useful if you are making an asyncronous AJAX call (e.g. urlFetch) and want to prevent the user clicking on any dialog items until the request is complete.
The optional css property object contains a collection of css property/value pairs to apply to the disable "shim". Possible uses are making the shim fully transparent or placing a "working" image somewhere via the background-image property.

To disable the UI...
xpertrule.disableUI();
To make the disable shim have a blue tint...
xpertrule.disableUI(
  {
    "background-color": "rgba(0, 0, 255, 0.2)"
  }
);
You can style the disable shim by modifying the .xrui-uidisable-shim class in your custom css.

xpertrule.enableUI

Syntax: xpertrule.enableUI();

Enable the user interface that has previously been disabled via the xpertrule.disableUI() method.

xpertrule.enableUI();

hierarchy.clear

Syntax: hierarchy.clear();

hierarchy.toString

Syntax: hierarchy.toString();